package com.medata.service.impl;

import com.medata.dataObject.History;
import com.medata.repository.HistoryRepository;
import com.medata.service.HistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;

/**
 * @author ：zb
 * @date ：Created in 2019/8/7 0007 18:05
 * @description：
 */
@Service
public class HistoryServiceImpl implements HistoryService {
    @Autowired
    private HistoryRepository repository;
    @Override
    public Page<History> findByUserName(String username,Pageable pageable) {
        return repository.findByUserName(username,pageable);
    }

    @Override
    public void save(History history) {
        repository.save(history);
    }

    @Override
    @Transactional
    public void deleteAll() {
        repository.deleteAll();
    }
}
